package com.thread.exception.demo3;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.thread.exception.ExceptionThread;
import com.thread.exception.demo2.MyUncaughtExceptionHandler;

public class SettingDefaultHandler {

	public static void main(String[] args) {
		// 如果代码中处处使用相同的异常处理器，则设置Thread.setDefaultUncaughtExceptionHandler()默认异常处理器
		Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler());
		ExecutorService exec = Executors.newCachedThreadPool();
		exec.execute(new ExceptionThread());
	}

}
